<template>
  <div class="finish-container">
    
    <!-- 导航栏 -->
    <div class="nav-bar">
      <div class="nav-left">
        <i class="nav-arrow" @click="goBack">‹</i>
      </div>
      <div class="nav-title">支付结果</div>
      <div class="nav-right"></div>
    </div>

    <!-- 主要内容 -->
    <div class="main-content">
      <div class="payment-details">
        <div class="detail-item">
          <span class="label">用电开始时间</span>
          <span class="value">{{ record.createdAt }}</span>
        </div>
        <div class="detail-item">
          <span class="label">用电结束时间</span>
          <span class="value">{{ record.finishedTime }}</span>
        </div>
        <div class="detail-item">
          <span class="label">用电时长</span>
          <span class="value">{{ record.useTime || '1' }}分</span>
        </div>
        <div class="detail-item">
          <span class="label">用电电量</span>
          <span class="value">{{ record.energy || '0.00' }}度</span>
        </div>
        <div class="detail-item">
          <span class="label">电费</span>
          <span class="value">{{ record.cost || '0' }}元</span>
        </div>
        <div class="detail-item">
          <span class="label">支付方式</span>
          <span class="value">微信</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Finish',
  data() {
    return {
      record: {}
    }
  },
  created() {
    this.record = window.record
    window.record = null
  },
  methods: {
    goBack() {
      this.$router.push('/wechat/index')
    }
  }
}
</script>

<style scoped>
.finish-container {
  min-height: 100vh;
  background: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 统一取消 i 标签和图标类的斜体样式 */
.finish-container i,
.close-icon,
.more-icon,
.nav-arrow {
  font-style: normal;
}

/* 状态栏样式 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #000;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signal-bars {
  display: flex;
  gap: 2px;
}

.bar {
  width: 3px;
  height: 6px;
  background: white;
  border-radius: 1px;
}

.battery {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 头部样式 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: white;
  border-bottom: 1px solid #f0f0f0;
}

.header-left,
.header-right {
  width: 40px;
  display: flex;
  align-items: center;
}

.header-center {
  flex: 1;
  text-align: center;
}

.title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.domain {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.close-icon,
.more-icon {
  font-size: 20px;
  color: #666;
  cursor: pointer;
}

/* 导航栏样式 */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #007aff;
  color: white;
}

.nav-left,
.nav-right {
  width: 40px;
  display: flex;
  align-items: center;
}

.nav-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.nav-arrow {
  font-size: 24px;
  cursor: pointer;
  color: white;
}

/* 主要内容样式 */
.main-content {
  padding: 20px 16px;
}

.payment-details {
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.detail-item:last-child {
  border-bottom: none;
}

.label {
  color: #666;
  font-size: 14px;
}

.value {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

/* 底部导航样式 */
.footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: white;
  border-top: 1px solid #f0f0f0;
}

.footer-nav .nav-arrow {
  font-size: 20px;
  color: #007aff;
  cursor: pointer;
}
</style>
